a few words about web development

[PHP] Problem with iconv(): Detected an illegal character in input string

Another straight to the point solution
If you have a script using iconv() to change encoding of a string and you run into this error:
iconv(): Detected an illegal character in input string
Then it simply means there is something in your string that cannot me mapped into your destination encoding.
You need to tell iconv() to handle this situation by adding //TRANSLIT to your encoding's name:

iconv('ANSI', 'utf-8//TRANSLIT', $string);

Comments